<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Index | 个人博客</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="https://cdn.jsdelivr.net/gh/qqlcx5/figure-bed@v1.0.0/image/polar_bear.jpg">
    <script async="async" src="https://hm.baidu.com/hm.js?662dade0b3fe9911e80442e86935e233"></script>
    <meta name="description" content="前端博客,个人技术博客,前端,前端开发,前端框架,web前端,前端面试题,技术文档,学习,面试,JavaScript,js,ES6,TypeScript,vue,python,css3,html5,Node,git,github,markdown">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <meta name="keywords" content="前端博客,个人技术博客,前端,前端开发,前端框架,web前端,前端面试题,技术文档,学习,面试,JavaScript,js,ES6,TypeScript,vue,python,css3,html5,Node,git,github,markdown">
    <meta name="theme-color" content="#11a8cd">
    
    <link rel="preload" href="/saas-vuepress/assets/css/0.styles.b127ab38.css" as="style"><link rel="preload" href="/saas-vuepress/assets/js/app.fa9b9339.js" as="script"><link rel="preload" href="/saas-vuepress/assets/js/2.03dacb0b.js" as="script"><link rel="preload" href="/saas-vuepress/assets/js/60.e5e36495.js" as="script"><link rel="prefetch" href="/saas-vuepress/assets/js/10.694c1f9b.js"><link rel="prefetch" href="/saas-vuepress/assets/js/100.c7689fff.js"><link rel="prefetch" href="/saas-vuepress/assets/js/101.9af96cb7.js"><link rel="prefetch" href="/saas-vuepress/assets/js/102.99475b6f.js"><link rel="prefetch" href="/saas-vuepress/assets/js/103.c9d091f6.js"><link rel="prefetch" href="/saas-vuepress/assets/js/104.1009c720.js"><link rel="prefetch" href="/saas-vuepress/assets/js/105.d537fa90.js"><link rel="prefetch" href="/saas-vuepress/assets/js/106.98a4dabb.js"><link rel="prefetch" href="/saas-vuepress/assets/js/107.78b62d44.js"><link rel="prefetch" href="/saas-vuepress/assets/js/108.a267cb41.js"><link rel="prefetch" href="/saas-vuepress/assets/js/109.55d7058d.js"><link rel="prefetch" href="/saas-vuepress/assets/js/11.6a7519cb.js"><link rel="prefetch" href="/saas-vuepress/assets/js/110.df9942aa.js"><link rel="prefetch" href="/saas-vuepress/assets/js/111.7537b42c.js"><link rel="prefetch" href="/saas-vuepress/assets/js/112.7e2567b8.js"><link rel="prefetch" href="/saas-vuepress/assets/js/113.2cabdb03.js"><link rel="prefetch" href="/saas-vuepress/assets/js/114.3ab0f8ec.js"><link rel="prefetch" href="/saas-vuepress/assets/js/115.f61e8285.js"><link rel="prefetch" href="/saas-vuepress/assets/js/116.88a464e4.js"><link rel="prefetch" href="/saas-vuepress/assets/js/117.3b7c82dd.js"><link rel="prefetch" href="/saas-vuepress/assets/js/118.f457df12.js"><link rel="prefetch" href="/saas-vuepress/assets/js/119.c01d1cab.js"><link rel="prefetch" href="/saas-vuepress/assets/js/12.30ce9516.js"><link rel="prefetch" href="/saas-vuepress/assets/js/120.98c2000e.js"><link rel="prefetch" href="/saas-vuepress/assets/js/121.ceea03b1.js"><link rel="prefetch" href="/saas-vuepress/assets/js/122.820456eb.js"><link rel="prefetch" href="/saas-vuepress/assets/js/123.2c1d01b4.js"><link rel="prefetch" href="/saas-vuepress/assets/js/124.0bd539fd.js"><link rel="prefetch" href="/saas-vuepress/assets/js/125.23a0d200.js"><link rel="prefetch" href="/saas-vuepress/assets/js/126.8bdc3c39.js"><link rel="prefetch" href="/saas-vuepress/assets/js/127.17046da4.js"><link rel="prefetch" href="/saas-vuepress/assets/js/128.37bf9c00.js"><link rel="prefetch" href="/saas-vuepress/assets/js/129.aa8dd5e3.js"><link rel="prefetch" href="/saas-vuepress/assets/js/13.ee5d5b4c.js"><link rel="prefetch" href="/saas-vuepress/assets/js/130.c2683fa6.js"><link rel="prefetch" href="/saas-vuepress/assets/js/131.1fdb6791.js"><link rel="prefetch" href="/saas-vuepress/assets/js/14.950c6af7.js"><link rel="prefetch" href="/saas-vuepress/assets/js/15.80980eb9.js"><link rel="prefetch" href="/saas-vuepress/assets/js/16.1999adea.js"><link rel="prefetch" href="/saas-vuepress/assets/js/17.c7711021.js"><link rel="prefetch" href="/saas-vuepress/assets/js/18.25c22728.js"><link rel="prefetch" href="/saas-vuepress/assets/js/19.db7c38aa.js"><link rel="prefetch" href="/saas-vuepress/assets/js/20.b85fddaa.js"><link rel="prefetch" href="/saas-vuepress/assets/js/21.1db2aa08.js"><link rel="prefetch" href="/saas-vuepress/assets/js/22.836f2d02.js"><link rel="prefetch" href="/saas-vuepress/assets/js/23.bba7ac7b.js"><link rel="prefetch" href="/saas-vuepress/assets/js/24.c7032827.js"><link rel="prefetch" href="/saas-vuepress/assets/js/25.70228854.js"><link rel="prefetch" href="/saas-vuepress/assets/js/26.3ae08475.js"><link rel="prefetch" href="/saas-vuepress/assets/js/27.d4c45324.js"><link rel="prefetch" href="/saas-vuepress/assets/js/28.95438191.js"><link rel="prefetch" href="/saas-vuepress/assets/js/29.36d4e3da.js"><link rel="prefetch" href="/saas-vuepress/assets/js/3.85921ad7.js"><link rel="prefetch" href="/saas-vuepress/assets/js/30.291a3c91.js"><link rel="prefetch" href="/saas-vuepress/assets/js/31.b07e726b.js"><link rel="prefetch" href="/saas-vuepress/assets/js/32.dbb0082c.js"><link rel="prefetch" href="/saas-vuepress/assets/js/33.6dceddfe.js"><link rel="prefetch" href="/saas-vuepress/assets/js/34.4361e184.js"><link rel="prefetch" href="/saas-vuepress/assets/js/35.a8be0f9b.js"><link rel="prefetch" href="/saas-vuepress/assets/js/36.cf6c4bed.js"><link rel="prefetch" href="/saas-vuepress/assets/js/37.db8a983b.js"><link rel="prefetch" href="/saas-vuepress/assets/js/38.928e4457.js"><link rel="prefetch" href="/saas-vuepress/assets/js/39.ce656415.js"><link rel="prefetch" href="/saas-vuepress/assets/js/4.a540a415.js"><link rel="prefetch" href="/saas-vuepress/assets/js/40.015f7ed5.js"><link rel="prefetch" href="/saas-vuepress/assets/js/41.65efab94.js"><link rel="prefetch" href="/saas-vuepress/assets/js/42.e4b051b4.js"><link rel="prefetch" href="/saas-vuepress/assets/js/43.8b10d5db.js"><link rel="prefetch" href="/saas-vuepress/assets/js/44.b2659fd6.js"><link rel="prefetch" href="/saas-vuepress/assets/js/45.0a1871c7.js"><link rel="prefetch" href="/saas-vuepress/assets/js/46.ee674bf3.js"><link rel="prefetch" href="/saas-vuepress/assets/js/47.7461dfbb.js"><link rel="prefetch" href="/saas-vuepress/assets/js/48.a14b85e8.js"><link rel="prefetch" href="/saas-vuepress/assets/js/49.423ed53e.js"><link rel="prefetch" href="/saas-vuepress/assets/js/5.31489c9d.js"><link rel="prefetch" href="/saas-vuepress/assets/js/50.774f5f6a.js"><link rel="prefetch" href="/saas-vuepress/assets/js/51.1a5fc27c.js"><link rel="prefetch" href="/saas-vuepress/assets/js/52.adae1df6.js"><link rel="prefetch" href="/saas-vuepress/assets/js/53.a484c390.js"><link rel="prefetch" href="/saas-vuepress/assets/js/54.9077bcb6.js"><link rel="prefetch" href="/saas-vuepress/assets/js/55.d7ed3bf6.js"><link rel="prefetch" href="/saas-vuepress/assets/js/56.f496ee38.js"><link rel="prefetch" href="/saas-vuepress/assets/js/57.347b8e56.js"><link rel="prefetch" href="/saas-vuepress/assets/js/58.e299a281.js"><link rel="prefetch" href="/saas-vuepress/assets/js/59.aa26c2a0.js"><link rel="prefetch" href="/saas-vuepress/assets/js/6.3770f528.js"><link rel="prefetch" href="/saas-vuepress/assets/js/61.08bdec95.js"><link rel="prefetch" href="/saas-vuepress/assets/js/62.706b0f3e.js"><link rel="prefetch" href="/saas-vuepress/assets/js/63.030ae462.js"><link rel="prefetch" href="/saas-vuepress/assets/js/64.40830457.js"><link rel="prefetch" href="/saas-vuepress/assets/js/65.019b6b71.js"><link rel="prefetch" href="/saas-vuepress/assets/js/66.4233e242.js"><link rel="prefetch" href="/saas-vuepress/assets/js/67.8d22de74.js"><link rel="prefetch" href="/saas-vuepress/assets/js/68.44a5978e.js"><link rel="prefetch" href="/saas-vuepress/assets/js/69.0a559927.js"><link rel="prefetch" href="/saas-vuepress/assets/js/7.c9695630.js"><link rel="prefetch" href="/saas-vuepress/assets/js/70.c62d31fb.js"><link rel="prefetch" href="/saas-vuepress/assets/js/71.045cc192.js"><link rel="prefetch" href="/saas-vuepress/assets/js/72.ce37961a.js"><link rel="prefetch" href="/saas-vuepress/assets/js/73.af2893c7.js"><link rel="prefetch" href="/saas-vuepress/assets/js/74.f220272c.js"><link rel="prefetch" href="/saas-vuepress/assets/js/75.b531c409.js"><link rel="prefetch" href="/saas-vuepress/assets/js/76.919d7a27.js"><link rel="prefetch" href="/saas-vuepress/assets/js/77.ddab4b6d.js"><link rel="prefetch" href="/saas-vuepress/assets/js/78.70f1b9a2.js"><link rel="prefetch" href="/saas-vuepress/assets/js/79.816612ff.js"><link rel="prefetch" href="/saas-vuepress/assets/js/8.ddd1baf7.js"><link rel="prefetch" href="/saas-vuepress/assets/js/80.4f614128.js"><link rel="prefetch" href="/saas-vuepress/assets/js/81.064c7f61.js"><link rel="prefetch" href="/saas-vuepress/assets/js/82.b9ea733a.js"><link rel="prefetch" href="/saas-vuepress/assets/js/83.e7f64816.js"><link rel="prefetch" href="/saas-vuepress/assets/js/84.b255df78.js"><link rel="prefetch" href="/saas-vuepress/assets/js/85.35756ce8.js"><link rel="prefetch" href="/saas-vuepress/assets/js/86.19c8558a.js"><link rel="prefetch" href="/saas-vuepress/assets/js/87.aa6fa757.js"><link rel="prefetch" href="/saas-vuepress/assets/js/88.703dba52.js"><link rel="prefetch" href="/saas-vuepress/assets/js/89.6ce30efd.js"><link rel="prefetch" href="/saas-vuepress/assets/js/9.f77824c4.js"><link rel="prefetch" href="/saas-vuepress/assets/js/90.695919ef.js"><link rel="prefetch" href="/saas-vuepress/assets/js/91.3a6f04b2.js"><link rel="prefetch" href="/saas-vuepress/assets/js/92.c17ba399.js"><link rel="prefetch" href="/saas-vuepress/assets/js/93.7fd4aef1.js"><link rel="prefetch" href="/saas-vuepress/assets/js/94.d0f283fc.js"><link rel="prefetch" href="/saas-vuepress/assets/js/95.71759539.js"><link rel="prefetch" href="/saas-vuepress/assets/js/96.ffbe6ab0.js"><link rel="prefetch" href="/saas-vuepress/assets/js/97.13de9047.js"><link rel="prefetch" href="/saas-vuepress/assets/js/98.d8617209.js"><link rel="prefetch" href="/saas-vuepress/assets/js/99.3788669b.js">
    <link rel="stylesheet" href="/saas-vuepress/assets/css/0.styles.b127ab38.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/saas-vuepress/" class="home-link router-link-active"><!----> <span class="site-name">个人博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/saas-vuepress/指南/10.基础/01.介绍.html" class="nav-link">
  指南
</a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/saas-vuepress/指南/10.基础/01.介绍.html" class="nav-link">
  指南
</a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>基础</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/10.基础/01.介绍.html" class="sidebar-link">介绍</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>assets</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/20.assets/01.styles.html" class="sidebar-link">styles</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/30.common/01.components组件.html" class="sidebar-link">components组件</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-components</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/31.common-components/01.c-button.html" class="sidebar-link">c-button</a></li><li><a href="/saas-vuepress/指南/31.common-components/02.c-cell.html" class="sidebar-link">c-cell</a></li><li><a href="/saas-vuepress/指南/31.common-components/03.c-checkbox.html" class="sidebar-link">c-checkbox</a></li><li><a href="/saas-vuepress/指南/31.common-components/04.c-layout.html" class="sidebar-link">c-layout</a></li><li><a href="/saas-vuepress/指南/31.common-components/05.c-colors.html" class="sidebar-link">c-colors</a></li><li><a href="/saas-vuepress/指南/31.common-components/06.c-count-down.html" class="sidebar-link">c-count-down</a></li><li><a href="/saas-vuepress/指南/31.common-components/07.c-fixed-menu.html" class="sidebar-link">c-fixed-menu</a></li><li><a href="/saas-vuepress/指南/31.common-components/08.c-icons.html" class="sidebar-link">c-icons</a></li><li><a href="/saas-vuepress/指南/31.common-components/09.c-image.html" class="sidebar-link">c-image</a></li><li><a href="/saas-vuepress/指南/31.common-components/10.c-input.html" class="sidebar-link">c-input</a></li><li><a href="/saas-vuepress/指南/31.common-components/11.c-jyf-parser.html" class="sidebar-link">c-jyf-parser</a></li><li><a href="/saas-vuepress/指南/31.common-components/12.c-live-player.html" class="sidebar-link">c-live-player</a></li><li><a href="/saas-vuepress/指南/31.common-components/13.c-loading.html" class="sidebar-link">c-loading</a></li><li><a href="/saas-vuepress/指南/31.common-components/14.c-mask.html" class="sidebar-link">c-mask</a></li><li><a href="/saas-vuepress/指南/31.common-components/15.c-modal.html" class="sidebar-link">c-modal</a></li><li><a href="/saas-vuepress/指南/31.common-components/16.c-page-head.html" class="sidebar-link">c-page-head</a></li><li><a href="/saas-vuepress/指南/31.common-components/17.c-popup.html" class="sidebar-link">c-popup</a></li><li><a href="/saas-vuepress/指南/31.common-components/18.c-radio.html" class="sidebar-link">c-radio</a></li><li><a href="/saas-vuepress/指南/31.common-components/19.c-recommend.html" class="sidebar-link">c-recommend</a></li><li><a href="/saas-vuepress/指南/31.common-components/20.c-recommend-goods.html" class="sidebar-link">c-recommend-goods</a></li><li><a href="/saas-vuepress/指南/31.common-components/21.c-row.html" class="sidebar-link">c-row</a></li><li><a href="/saas-vuepress/指南/31.common-components/22.c-select-city.html" class="sidebar-link">c-select-city</a></li><li><a href="/saas-vuepress/指南/31.common-components/23.c-select-spec.html" class="sidebar-link">c-select-spec</a></li><li><a href="/saas-vuepress/指南/31.common-components/24.c-share-wechat.html" class="sidebar-link">c-share-wechat</a></li><li><a href="/saas-vuepress/指南/31.common-components/25.c-status-bar.html" class="sidebar-link">c-status-bar</a></li><li><a href="/saas-vuepress/指南/31.common-components/26.c-subscribe.html" class="sidebar-link">c-subscribe</a></li><li><a href="/saas-vuepress/指南/31.common-components/27.c-subsection.html" class="sidebar-link">c-subsection</a></li><li><a href="/saas-vuepress/指南/31.common-components/28.c-swipe-action.html" class="sidebar-link">c-swipe-action</a></li><li><a href="/saas-vuepress/指南/31.common-components/29.c-tabbar.html" class="sidebar-link">c-tabbar</a></li><li><a href="/saas-vuepress/指南/31.common-components/30.c-coupon-popup.html" class="sidebar-link">c-coupon-popup</a></li><li><a href="/saas-vuepress/指南/31.common-components/31.c-coupon-detail.html" class="sidebar-link">c-coupon-detail</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-config</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/32.common-config/01.index.html" class="sidebar-link">index</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-filters</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/33.common-filters/01.index.html" class="sidebar-link">index</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-mixins</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/34.common-mixins/06.globalMixins.html" class="sidebar-link">globalMixins</a></li><li><a href="/saas-vuepress/指南/34.common-mixins/07.list.html" class="sidebar-link">list</a></li><li><a href="/saas-vuepress/指南/34.common-mixins/08.pay.html" class="sidebar-link">pay</a></li><li><a href="/saas-vuepress/指南/34.common-mixins/09.pushMessage.html" class="sidebar-link">pushMessage</a></li><li><a href="/saas-vuepress/指南/34.common-mixins/10.realName.html" class="sidebar-link">realName</a></li><li><a href="/saas-vuepress/指南/34.common-mixins/11.share.html" class="sidebar-link">share</a></li><li><a href="/saas-vuepress/指南/34.common-mixins/12.shareMixins.html" class="sidebar-link">shareMixins</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-router</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/35.common-router/01.index.html" class="sidebar-link">index</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-service</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/36.common-service/01.index.html" class="sidebar-link">index</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-styles</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/37.common-styles/01.index.html" class="sidebar-link">index</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>common-utils</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/38.common-utils/01.cavasTool.html" class="sidebar-link">cavasTool</a></li><li><a href="/saas-vuepress/指南/38.common-utils/02.colorGradient.html" class="sidebar-link">colorGradient</a></li><li><a href="/saas-vuepress/指南/38.common-utils/03.common.html" class="sidebar-link">common</a></li><li><a href="/saas-vuepress/指南/38.common-utils/04.countDown.html" class="sidebar-link">countDown</a></li><li><a href="/saas-vuepress/指南/38.common-utils/05.emitter.html" class="sidebar-link">emitter</a></li><li><a href="/saas-vuepress/指南/38.common-utils/06.global.html" class="sidebar-link">global</a></li><li><a href="/saas-vuepress/指南/38.common-utils/07.index.html" class="active sidebar-link">index</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#setarrdata" class="sidebar-link">setArrData</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#isarrayequal" class="sidebar-link">isArrayEqual</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#numformat" class="sidebar-link">numFormat</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#isimg" class="sidebar-link">isImg</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#parse" class="sidebar-link">parse</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#geturlquery" class="sidebar-link">getUrlQuery</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#getrandomnum" class="sidebar-link">getRandomNum</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#debounce" class="sidebar-link">debounce</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#throttle" class="sidebar-link">throttle</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#copytext" class="sidebar-link">copyText</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#diffbyobj" class="sidebar-link">diffByObj</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#getrect" class="sidebar-link">getRect</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#getparent" class="sidebar-link">getParent</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#guid" class="sidebar-link">guid</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#addunit" class="sidebar-link">addUnit</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#calcfn" class="sidebar-link">calcFn</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#formatunit" class="sidebar-link">formatUnit</a></li><li class="sidebar-sub-header"><a href="/saas-vuepress/指南/38.common-utils/07.index.html#colortorgba" class="sidebar-link">colorToRgba</a></li></ul></li><li><a href="/saas-vuepress/指南/38.common-utils/08.pay.html" class="sidebar-link">pay</a></li><li><a href="/saas-vuepress/指南/38.common-utils/09.tool.html" class="sidebar-link">tool</a></li><li><a href="/saas-vuepress/指南/38.common-utils/10.validate.html" class="sidebar-link">validate</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>common-scss</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/39.common-scss/01.index.html" class="sidebar-link">index</a></li><li><a href="/saas-vuepress/指南/39.common-scss/02.theme.html" class="sidebar-link">theme</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>components</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/40.components/01.formBase.html" class="sidebar-link">formBase</a></li><li><a href="/saas-vuepress/指南/40.components/02.ss-share-wechat.html" class="sidebar-link">ss-share-wechat</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>goods目录</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/60.goods目录/01.collect商品收藏.html" class="sidebar-link">collect商品收藏</a></li><li><a href="/saas-vuepress/指南/60.goods目录/01.商品收藏.html" class="sidebar-link">商品收藏</a></li><li><a href="/saas-vuepress/指南/60.goods目录/03.details商品详情.html" class="sidebar-link">details商品详情</a></li><li><a href="/saas-vuepress/指南/60.goods目录/03.商品详情.html" class="sidebar-link">商品详情</a></li><li><a href="/saas-vuepress/指南/60.goods目录/04.group拼团.html" class="sidebar-link">group拼团</a></li><li><a href="/saas-vuepress/指南/60.goods目录/05.hot-selling精选好物.html" class="sidebar-link">hot-selling精选好物</a></li><li><a href="/saas-vuepress/指南/60.goods目录/06.logistics物流.html" class="sidebar-link">logistics物流</a></li><li><a href="/saas-vuepress/指南/60.goods目录/07.newGift新人专享福利.html" class="sidebar-link">newGift新人专享福利</a></li><li><a href="/saas-vuepress/指南/60.goods目录/08.order订单、拼团.html" class="sidebar-link">order订单、拼团</a></li><li><a href="/saas-vuepress/指南/60.goods目录/09.refuse售后.html" class="sidebar-link">refuse售后</a></li><li><a href="/saas-vuepress/指南/60.goods目录/10.search搜索.html" class="sidebar-link">search搜索</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>goods-components</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/61.goods-components/01.details-introduce.html" class="sidebar-link">details-introduce</a></li><li><a href="/saas-vuepress/指南/61.goods-components/02.details-tabs.html" class="sidebar-link">details-tabs</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>order订单</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/68.order订单/01.list订单列表.html" class="sidebar-link">list订单列表</a></li><li><a href="/saas-vuepress/指南/68.order订单/02.details商品详情.html" class="sidebar-link">details商品详情</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>refuse订单售后</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/69.refuse订单售后/01.list订单列表.html" class="sidebar-link">list订单列表</a></li><li><a href="/saas-vuepress/指南/69.refuse订单售后/02.details商品详情.html" class="sidebar-link">details商品详情</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>guest目录</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/70.guest目录/01.爆品视频模块.html" class="sidebar-link">爆品视频模块</a></li><li><a href="/saas-vuepress/指南/70.guest目录/02.工长模块.html" class="sidebar-link">工长模块</a></li><li><a href="/saas-vuepress/指南/70.guest目录/03.设计师模块.html" class="sidebar-link">设计师模块</a></li><li><a href="/saas-vuepress/指南/70.guest目录/04.优惠券模块.html" class="sidebar-link">优惠券模块</a></li><li><a href="/saas-vuepress/指南/70.guest目录/05.案例模块.html" class="sidebar-link">案例模块</a></li><li><a href="/saas-vuepress/指南/70.guest目录/06.攻略模块.html" class="sidebar-link">攻略模块</a></li><li><a href="/saas-vuepress/指南/70.guest目录/07.选择地址定位.html" class="sidebar-link">选择地址定位</a></li><li><a href="/saas-vuepress/指南/70.guest目录/08.套餐模块.html" class="sidebar-link">套餐模块</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>home-index-conmponents首页组件</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/01.banner轮播图.html" class="sidebar-link">banner轮播图</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/02.card精选品牌.html" class="sidebar-link">card精选品牌</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/03.case-list装修案例.html" class="sidebar-link">case-list装修案例</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/04.classification品类分类.html" class="sidebar-link">classification品类分类</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/05.combo整装套餐.html" class="sidebar-link">combo整装套餐</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/06.couple新人礼.html" class="sidebar-link">couple新人礼</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/07.designer设计师.html" class="sidebar-link">designer设计师</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/08.features-bottom特色服务.html" class="sidebar-link">features-bottom特色服务</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/09.goodslist推荐商品.html" class="sidebar-link">goodslist推荐商品</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/11.matrixMenu子菜单.html" class="sidebar-link">matrixMenu子菜单</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/12.module-title更多.html" class="sidebar-link">module-title更多</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/13.slide-menu侧边按钮.html" class="sidebar-link">slide-menu侧边按钮</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/14.timeTabs限时秒杀.html" class="sidebar-link">timeTabs限时秒杀</a></li><li><a href="/saas-vuepress/指南/80-1.home-index-conmponents首页组件/15.topSearchAndTabs头部搜索.html" class="sidebar-link">topSearchAndTabs头部搜索</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>首页组件</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/80-1.首页组件/01.banner轮播图.html" class="sidebar-link">banner轮播图</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/02.card精选品牌.html" class="sidebar-link">card精选品牌</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/03.case-list装修案例.html" class="sidebar-link">case-list装修案例</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/04.classification品类分类.html" class="sidebar-link">classification品类分类</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/05.combo整装套餐.html" class="sidebar-link">combo整装套餐</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/06.couple新人礼.html" class="sidebar-link">couple新人礼</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/07.designer设计师.html" class="sidebar-link">designer设计师</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/08.features-bottom特色服务.html" class="sidebar-link">features-bottom特色服务</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/09.goodslist推荐商品.html" class="sidebar-link">goodslist推荐商品</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/11.matrixMenu子菜单.html" class="sidebar-link">matrixMenu子菜单</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/12.module-title更多.html" class="sidebar-link">module-title更多</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/12.module-title模块标题.html" class="sidebar-link">module-title模块标题</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/13.slide-menu侧边按钮.html" class="sidebar-link">slide-menu侧边按钮</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/14.timeTabs限时秒杀.html" class="sidebar-link">timeTabs限时秒杀</a></li><li><a href="/saas-vuepress/指南/80-1.首页组件/15.topSearchAndTabs头部搜索.html" class="sidebar-link">topSearchAndTabs头部搜索</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>home目录</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/saas-vuepress/指南/80.home目录/01.category商品分类.html" class="sidebar-link">category商品分类</a></li><li><a href="/saas-vuepress/指南/80.home目录/01.商品分类.html" class="sidebar-link">商品分类</a></li><li><a href="/saas-vuepress/指南/80.home目录/02.index首页.html" class="sidebar-link">index首页</a></li><li><a href="/saas-vuepress/指南/80.home目录/02.首页.html" class="sidebar-link">首页</a></li><li><a href="/saas-vuepress/指南/80.home目录/03.login登录.html" class="sidebar-link">login登录</a></li><li><a href="/saas-vuepress/指南/80.home目录/03.登录.html" class="sidebar-link">登录</a></li><li><a href="/saas-vuepress/指南/80.home目录/04.shopping-cart购物车.html" class="sidebar-link">shopping-cart购物车</a></li><li><a href="/saas-vuepress/指南/80.home目录/04.购物车.html" class="sidebar-link">购物车</a></li><li><a href="/saas-vuepress/指南/80.home目录/05.user我的.html" class="sidebar-link">user我的</a></li><li><a href="/saas-vuepress/指南/80.home目录/05.我的.html" class="sidebar-link">我的</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="index"><a href="#index" class="header-anchor">#</a> Index</h1> <h2 id="setarrdata"><a href="#setarrdata" class="header-anchor">#</a> setArrData</h2> <ul><li>一维数组转多维数组
<ul><li>@parmas arr { Array } 需要转化的原数组</li> <li>@parmas num { Number } 维度</li> <li>@return { Array }</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">setArrData</span><span class="token punctuation">(</span>Array<span class="token punctuation">,</span>Number<span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">setArrData</span><span class="token punctuation">(</span><span class="token parameter">arr <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span> num <span class="token operator">=</span> <span class="token number">2</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
	<span class="token keyword">let</span> newArr <span class="token operator">=</span> <span class="token function">deepClone</span><span class="token punctuation">(</span>arr<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">let</span> len <span class="token operator">=</span> Math<span class="token punctuation">.</span><span class="token function">ceil</span><span class="token punctuation">(</span>newArr<span class="token punctuation">.</span>length <span class="token operator">/</span> num<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">let</span> temp <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Array</span><span class="token punctuation">(</span>len<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> len<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
		temp<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> newArr<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span>i <span class="token operator">*</span> num<span class="token punctuation">,</span> <span class="token punctuation">(</span>i <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">*</span> num<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	<span class="token keyword">return</span> temp<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="isarrayequal"><a href="#isarrayequal" class="header-anchor">#</a> isArrayEqual</h2> <ul><li>两数组是否相等</li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">isArrayEqual</span><span class="token punctuation">(</span>Array1<span class="token punctuation">,</span> Array2<span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> <span class="token function-variable function">isArrayEqual</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">a<span class="token punctuation">,</span> b<span class="token punctuation">,</span> has <span class="token operator">=</span> <span class="token boolean">true</span></span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>a<span class="token punctuation">.</span>length <span class="token operator">!==</span> b<span class="token punctuation">.</span>length<span class="token punctuation">)</span> <span class="token keyword">return</span> has <span class="token operator">=</span> <span class="token boolean">false</span>
    <span class="token keyword">const</span> s <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Set</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> a<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>s<span class="token punctuation">.</span><span class="token function">has</span><span class="token punctuation">(</span>a<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span> has <span class="token operator">=</span> <span class="token boolean">false</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> has
<span class="token punctuation">}</span>
</code></pre></div><h2 id="numformat"><a href="#numformat" class="header-anchor">#</a> numFormat</h2> <ul><li>价格、库存格式化
<ul><li>@parmas num {String | Number} 需要被格式化的字段</li> <li>@parmas type {String} 默认是金额格式化price，可选值：price | stock</li> <li>@return {Boolean}</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">numFormat</span><span class="token punctuation">(</span>price<span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">numFormat</span><span class="token punctuation">(</span>num<span class="token punctuation">,</span> type <span class="token operator">=</span> <span class="token string">'price'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> emptyArr <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'undefined'</span><span class="token punctuation">,</span> <span class="token string">'null'</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    num <span class="token operator">=</span> <span class="token function">String</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> num<span class="token punctuation">.</span>length <span class="token operator">===</span> <span class="token number">0</span> <span class="token operator">||</span> emptyArr<span class="token punctuation">.</span><span class="token function">includes</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span> <span class="token operator">?</span> <span class="token punctuation">(</span>type <span class="token operator">===</span> <span class="token string">'price'</span> <span class="token operator">?</span> allConfig<span class="token punctuation">.</span>priceNullText <span class="token operator">:</span> allConfig<span class="token punctuation">.</span>stockNullText<span class="token punctuation">)</span> <span class="token operator">:</span> num<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="isimg"><a href="#isimg" class="header-anchor">#</a> isImg</h2> <ul><li>是否是图片
<ul><li>@parmas src {String} 地址或者icon值</li> <li>@return {Boolean}</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">isImg</span><span class="token punctuation">(</span>src<span class="token punctuation">)</span><span class="token punctuation">;</span> 

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> <span class="token function-variable function">isImg</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">src</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
	<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>src<span class="token punctuation">)</span> <span class="token keyword">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
	<span class="token comment">//这个针对微信或者H5</span>
	<span class="token keyword">if</span><span class="token punctuation">(</span>src<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span><span class="token string">'data:image'</span><span class="token punctuation">)</span> <span class="token operator">!==</span> <span class="token operator">-</span><span class="token number">1</span> <span class="token operator">||</span> src<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span><span class="token string">'wxfile'</span><span class="token punctuation">)</span> <span class="token operator">!==</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
	<span class="token comment">// 远端地址都认为是图片</span>
	<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|&amp;|-)+)</span><span class="token regex-delimiter">/</span><span class="token regex-flags">g</span></span><span class="token punctuation">.</span><span class="token function">test</span><span class="token punctuation">(</span>src<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
		<span class="token keyword">return</span> <span class="token boolean">true</span>
	<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
		<span class="token keyword">var</span> imgFilter <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'jpeg'</span><span class="token punctuation">,</span> <span class="token string">'gif'</span><span class="token punctuation">,</span> <span class="token string">'jpg'</span><span class="token punctuation">,</span> <span class="token string">'png'</span><span class="token punctuation">,</span> <span class="token string">'bmp'</span><span class="token punctuation">,</span> <span class="token string">'pic'</span><span class="token punctuation">,</span> <span class="token string">'svg'</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">var</span> pos <span class="token operator">=</span> src<span class="token punctuation">.</span><span class="token function">lastIndexOf</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>pos<span class="token operator">++</span> <span class="token operator">&gt;</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
			<span class="token keyword">var</span> strPostfix1 <span class="token operator">=</span> src<span class="token punctuation">.</span><span class="token function">substr</span><span class="token punctuation">(</span>pos<span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">var</span> strPostfix2 <span class="token operator">=</span> src<span class="token punctuation">.</span><span class="token function">substr</span><span class="token punctuation">(</span>pos<span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">return</span> imgFilter<span class="token punctuation">.</span><span class="token function">includes</span><span class="token punctuation">(</span>strPostfix1<span class="token punctuation">)</span> <span class="token operator">?</span> <span class="token boolean">true</span> <span class="token operator">:</span> imgFilter<span class="token punctuation">.</span><span class="token function">includes</span><span class="token punctuation">(</span>strPostfix2<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span><span class="token keyword">else</span><span class="token punctuation">{</span>
			<span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="parse"><a href="#parse" class="header-anchor">#</a> parse</h2> <ul><li>对象参数转为url参数
<ul><li>@parmas query 拼接得参数对象</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token keyword">let</span> query <span class="token operator">=</span> <span class="token punctuation">{</span> id<span class="token operator">:</span><span class="token number">123</span> <span class="token punctuation">,</span> detailId<span class="token operator">:</span> <span class="token number">10</span> <span class="token punctuation">}</span>
<span class="token function">parse</span><span class="token punctuation">(</span>query<span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> <span class="token function-variable function">parse</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">query <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> Object<span class="token punctuation">.</span><span class="token function">keys</span><span class="token punctuation">(</span>query<span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">filter</span><span class="token punctuation">(</span><span class="token parameter">key</span> <span class="token operator">=&gt;</span> <span class="token operator">!</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>query<span class="token punctuation">[</span>key<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">result<span class="token punctuation">,</span> key</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
            <span class="token keyword">const</span> value <span class="token operator">=</span> query<span class="token punctuation">[</span>key<span class="token punctuation">]</span>
            <span class="token comment">// in查询特殊处理</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>Array<span class="token punctuation">.</span><span class="token function">isArray</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span> <span class="token operator">&amp;&amp;</span> <span class="token operator">!</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">return</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>result<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">&amp;</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>value<span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">val<span class="token punctuation">,</span> cVal</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>val <span class="token operator">?</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>val<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">&amp;</span><span class="token template-punctuation string">`</span></span> <span class="token operator">:</span> val<span class="token interpolation-punctuation punctuation">}</span></span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>key<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">=</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>cVal<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span> <span class="token string">''</span><span class="token punctuation">)</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span>
            <span class="token punctuation">}</span>

            <span class="token comment">// between查询做特殊处理</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">typeof</span> value <span class="token operator">===</span> <span class="token string">'object'</span> <span class="token operator">&amp;&amp;</span> <span class="token operator">!</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">const</span> <span class="token punctuation">[</span>start<span class="token punctuation">,</span> end<span class="token punctuation">]</span> <span class="token operator">=</span> value
                <span class="token keyword">return</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>result<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">&amp;</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>key<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">[]=</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>start<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">&amp;</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>key<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">[]=</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>end<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span>
            <span class="token punctuation">}</span>

            <span class="token keyword">return</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>result<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">&amp;</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>key<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">=</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>value<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token string">''</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">replace</span><span class="token punctuation">(</span><span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">^&amp;</span><span class="token regex-delimiter">/</span></span><span class="token punctuation">,</span> <span class="token string">'?'</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="geturlquery"><a href="#geturlquery" class="header-anchor">#</a> getUrlQuery</h2> <ul><li>拆解url地址成为路由跳转参数</li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">getUrlQuery</span><span class="token punctuation">(</span>path<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">getUrlQuery</span><span class="token punctuation">(</span><span class="token parameter">page</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> urlArr <span class="token operator">=</span> <span class="token function">String</span><span class="token punctuation">(</span>page<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'?'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> queryObj <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
    urlArr<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">&amp;&amp;</span> urlArr<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'&amp;'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">o</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> item <span class="token operator">=</span> o<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'='</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        item<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">?</span> queryObj<span class="token punctuation">[</span>item<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token operator">=</span> item<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">:</span> <span class="token string">''</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
        path<span class="token operator">:</span> urlArr<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        query<span class="token operator">:</span> queryObj
    <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="getrandomnum"><a href="#getrandomnum" class="header-anchor">#</a> getRandomNum</h2> <ul><li>生成从minNum到maxNum的随机数
<ul><li>@parmas minNum 最小数</li> <li>@parmas maxNum 最大数</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">getRandomNum</span><span class="token punctuation">(</span>minNum<span class="token punctuation">,</span> maxNum<span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">getRandomNum</span><span class="token punctuation">(</span><span class="token parameter">minNum<span class="token punctuation">,</span> maxNum</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">switch</span> <span class="token punctuation">(</span>arguments<span class="token punctuation">.</span>length<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">case</span> <span class="token number">1</span><span class="token operator">:</span>
            <span class="token keyword">return</span> <span class="token function">parseInt</span><span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">*</span> minNum <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span>
        <span class="token keyword">case</span> <span class="token number">2</span><span class="token operator">:</span>
            <span class="token keyword">return</span> <span class="token function">parseInt</span><span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token punctuation">(</span>maxNum <span class="token operator">-</span> minNum <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">+</span> minNum<span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span>
        <span class="token keyword">default</span><span class="token operator">:</span>
            <span class="token keyword">return</span> <span class="token number">0</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="debounce"><a href="#debounce" class="header-anchor">#</a> debounce</h2> <ul><li>防抖
<ul><li>@parmas fn 回调函数</li> <li>@parmas time 规定时间</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">debounce</span><span class="token punctuation">(</span>func<span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> debounce <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> timer <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">func<span class="token punctuation">,</span> wait <span class="token operator">=</span> <span class="token number">500</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> context <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">;</span> <span class="token comment">// 注意 this 指向</span>
        <span class="token keyword">let</span> args <span class="token operator">=</span> arguments<span class="token punctuation">;</span> <span class="token comment">// arguments中存着e</span>
        <span class="token keyword">let</span> name <span class="token operator">=</span> arguments<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>name <span class="token operator">||</span> <span class="token string">'arrow'</span><span class="token punctuation">;</span> <span class="token comment">//箭头函数</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>timer<span class="token punctuation">[</span>name<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token function">clearTimeout</span><span class="token punctuation">(</span>timer<span class="token punctuation">[</span>name<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        timer<span class="token punctuation">[</span>name<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
            <span class="token function">func</span><span class="token punctuation">.</span><span class="token function">apply</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">,</span> args<span class="token punctuation">)</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span> wait<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h2 id="throttle"><a href="#throttle" class="header-anchor">#</a> throttle</h2> <ul><li>节流(规定的时间才触发)
<ul><li>@parmas fn 结束完运行的回调</li> <li>@parmas delay 规定时间</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">throttle</span><span class="token punctuation">(</span>func<span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> throttle <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> timeout <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">func<span class="token punctuation">,</span> wait</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> context <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">;</span>
        <span class="token keyword">let</span> args <span class="token operator">=</span> arguments<span class="token punctuation">;</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>timeout<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            timeout <span class="token operator">=</span> <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                timeout <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
                <span class="token function">func</span><span class="token punctuation">.</span><span class="token function">apply</span><span class="token punctuation">(</span>context<span class="token punctuation">,</span> args<span class="token punctuation">)</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span> wait<span class="token punctuation">)</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h2 id="copytext"><a href="#copytext" class="header-anchor">#</a> copyText</h2> <ul><li>复制到粘贴板
<ul><li>@parmas str 拷贝的字符</li> <li>@parmas success 成功回调</li> <li>@parmas error 失败回调</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">copyText</span><span class="token punctuation">(</span><span class="token punctuation">{</span> content<span class="token operator">:</span> <span class="token string">'拷贝的字符'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">copyText</span><span class="token punctuation">(</span><span class="token punctuation">{</span> content<span class="token punctuation">,</span> <span class="token function-variable function">success</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">title</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span>
  uni<span class="token punctuation">.</span><span class="token function">showToast</span><span class="token punctuation">(</span><span class="token punctuation">{</span> title<span class="token punctuation">,</span> icon<span class="token operator">:</span> <span class="token string">'none'</span><span class="token punctuation">,</span> duration<span class="token operator">:</span> <span class="token number">2000</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token function-variable function">error</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>content<span class="token punctuation">)</span> <span class="token keyword">return</span> <span class="token function">error</span><span class="token punctuation">(</span><span class="token string">'复制的内容不能为空 !'</span><span class="token punctuation">)</span>
    content <span class="token operator">=</span> <span class="token keyword">typeof</span> content <span class="token operator">===</span> <span class="token string">'string'</span> <span class="token operator">?</span> content <span class="token operator">:</span> content<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// 复制内容，必须字符串，数字需要转换为字符串</span>
    <span class="token comment">/**
     * 小程序端 和 app端的复制逻辑
     */</span>
    <span class="token comment">//#ifndef H5</span>
    uni<span class="token punctuation">.</span><span class="token function">setClipboardData</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
        data<span class="token operator">:</span> content<span class="token punctuation">,</span>
        <span class="token function-variable function">success</span><span class="token operator">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
          <span class="token function">success</span><span class="token punctuation">(</span><span class="token string">&quot;复制成功~&quot;</span><span class="token punctuation">)</span>
          <span class="token comment">// this.$toast('复制成功~')</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token function-variable function">fail</span><span class="token operator">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
          <span class="token function">error</span><span class="token punctuation">(</span><span class="token string">&quot;复制失败~&quot;</span><span class="token punctuation">)</span>
          <span class="token comment">// this.$toast('复制失败~')</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token comment">//#endif</span>

    <span class="token comment">/**
     * H5端的复制逻辑
     */</span>
    <span class="token comment">// #ifdef H5</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>document<span class="token punctuation">.</span><span class="token function">queryCommandSupported</span><span class="token punctuation">(</span><span class="token string">'copy'</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">//为了兼容有些浏览器 queryCommandSupported 的判断</span>
        <span class="token comment">// 不支持</span>
        <span class="token function">error</span><span class="token punctuation">(</span><span class="token string">'浏览器不支持'</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">let</span> textarea <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">createElement</span><span class="token punctuation">(</span><span class="token string">&quot;textarea&quot;</span><span class="token punctuation">)</span>
    textarea<span class="token punctuation">.</span>value <span class="token operator">=</span> content
    textarea<span class="token punctuation">.</span>readOnly <span class="token operator">=</span> <span class="token string">&quot;readOnly&quot;</span>
    document<span class="token punctuation">.</span>body<span class="token punctuation">.</span><span class="token function">appendChild</span><span class="token punctuation">(</span>textarea<span class="token punctuation">)</span>
    textarea<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// 选择对象</span>
    textarea<span class="token punctuation">.</span><span class="token function">setSelectionRange</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> content<span class="token punctuation">.</span>length<span class="token punctuation">)</span> <span class="token comment">//核心</span>
    <span class="token keyword">let</span> result <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">execCommand</span><span class="token punctuation">(</span><span class="token string">&quot;copy&quot;</span><span class="token punctuation">)</span> <span class="token comment">// 执行浏览器复制命令</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>result<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token function">success</span><span class="token punctuation">(</span><span class="token string">&quot;复制成功~&quot;</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
        <span class="token function">error</span><span class="token punctuation">(</span><span class="token string">&quot;复制失败，请检查h5中调用该方法的方式，是不是用户点击的方式调用的，如果不是请改为用户点击的方式触发该方法，因为h5中安全性，不能js直接调用！&quot;</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
    textarea<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token comment">// #endif</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="diffbyobj"><a href="#diffbyobj" class="header-anchor">#</a> diffByObj</h2> <ul><li>判断对象是否相等</li></ul> <div class="language-js extra-class"><pre class="language-js"><code> <span class="token comment">//使用方法如下</span>
<span class="token keyword">this</span><span class="token punctuation">.</span>$c<span class="token punctuation">.</span><span class="token function">diffByObj</span><span class="token punctuation">(</span>obj1<span class="token punctuation">,</span> obj2<span class="token punctuation">)</span>
 
 <span class="token comment">//方法</span>
 <span class="token keyword">export</span> <span class="token keyword">const</span> <span class="token function-variable function">diffByObj</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">obj1<span class="token punctuation">,</span> obj2</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
     <span class="token keyword">var</span> o1 <span class="token operator">=</span> obj1 <span class="token keyword">instanceof</span> <span class="token class-name">Object</span><span class="token punctuation">;</span>
     <span class="token keyword">var</span> o2 <span class="token operator">=</span> obj2 <span class="token keyword">instanceof</span> <span class="token class-name">Object</span><span class="token punctuation">;</span>
     <span class="token comment">// 判断是不是对象</span>
     <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>o1 <span class="token operator">||</span> <span class="token operator">!</span>o2<span class="token punctuation">)</span> <span class="token punctuation">{</span>
         <span class="token keyword">return</span> obj1 <span class="token operator">===</span> obj2<span class="token punctuation">;</span>
     <span class="token punctuation">}</span>
 
     <span class="token comment">//Object.keys() 返回一个由对象的自身可枚举属性(key值)组成的数组,</span>
     <span class="token comment">//例如：数组返回下表：let arr = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;];console.log(Object.keys(arr))-&gt;0,1,2;</span>
     <span class="token keyword">if</span> <span class="token punctuation">(</span>Object<span class="token punctuation">.</span><span class="token function">keys</span><span class="token punctuation">(</span>obj1<span class="token punctuation">)</span><span class="token punctuation">.</span>length <span class="token operator">!==</span> Object<span class="token punctuation">.</span><span class="token function">keys</span><span class="token punctuation">(</span>obj2<span class="token punctuation">)</span><span class="token punctuation">.</span>length<span class="token punctuation">)</span> <span class="token punctuation">{</span>
         <span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
     <span class="token punctuation">}</span>
     <span class="token keyword">var</span> isDif <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
     <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">var</span> o <span class="token keyword">in</span> obj1<span class="token punctuation">)</span> <span class="token punctuation">{</span>
         <span class="token keyword">var</span> t1 <span class="token operator">=</span> obj1<span class="token punctuation">[</span>o<span class="token punctuation">]</span> <span class="token keyword">instanceof</span> <span class="token class-name">Object</span><span class="token punctuation">;</span>
         <span class="token keyword">var</span> t2 <span class="token operator">=</span> obj2<span class="token punctuation">[</span>o<span class="token punctuation">]</span> <span class="token keyword">instanceof</span> <span class="token class-name">Object</span><span class="token punctuation">;</span>
         <span class="token keyword">if</span> <span class="token punctuation">(</span>t1 <span class="token operator">&amp;&amp;</span> t2<span class="token punctuation">)</span> <span class="token punctuation">{</span>
             isDif <span class="token operator">=</span> <span class="token function">diffByObj</span><span class="token punctuation">(</span>obj1<span class="token punctuation">[</span>o<span class="token punctuation">]</span><span class="token punctuation">,</span> obj2<span class="token punctuation">[</span>o<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
         <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>obj1<span class="token punctuation">[</span>o<span class="token punctuation">]</span> <span class="token operator">!==</span> obj2<span class="token punctuation">[</span>o<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
             isDif <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
             <span class="token keyword">break</span><span class="token punctuation">;</span>
         <span class="token punctuation">}</span>
     <span class="token punctuation">}</span>
     <span class="token keyword">return</span> isDif<span class="token punctuation">;</span>
 <span class="token punctuation">}</span>
</code></pre></div><h2 id="getrect"><a href="#getrect" class="header-anchor">#</a> getRect</h2> <ul><li>获取节点的相关信息。
<ul><li>@parmas selecter 元素的class或者id</li> <li>@parmas fields，默认size</li> <li>id	Boolean	false	否	是否返回节点 id</li> <li>dataset	Boolean	false	否	是否返回节点 dataset	App、微信小程序、H5</li> <li>rect	Boolean	false	否	是否返回节点布局位置（left right top bottom）</li> <li>size	Boolean	false	否	是否返回节点尺寸（width height）</li> <li>scrollOffset	Boolean	false	否	是否返回节点的 scrollLeft scrollTop，节点必须是 scroll-view 或者 viewport</li> <li>properties	Array＜string＞	[]	否	指定属性名列表，返回节点对应属性名的当前属性值（只能获得组件文档中标注的常规属性值，id class style 和事件绑定的属性值不可获取）	仅 App 和微信小程序支持</li> <li>computedStyle	Array＜string＞	[]	否	指定样式名列表，返回节点对应样式名的当前值	仅 App 和微信小程序支持</li> <li>context	Boolean	false	否	是否返回节点对应的 Context 对象	仅 App 和微信小程序支持</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">getRect</span><span class="token punctuation">(</span><span class="token parameter">selecter<span class="token punctuation">,</span> pro <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> isSelectAll <span class="token operator">=</span> selecter<span class="token punctuation">.</span><span class="token function">lastIndexOf</span><span class="token punctuation">(</span><span class="token string">','</span><span class="token punctuation">)</span> <span class="token operator">!==</span> <span class="token operator">-</span><span class="token number">1</span> <span class="token operator">||</span> selecter<span class="token punctuation">.</span><span class="token function">lastIndexOf</span><span class="token punctuation">(</span><span class="token string">'.'</span><span class="token punctuation">)</span> <span class="token operator">!==</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token keyword">new</span> <span class="token class-name">Promise</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">res<span class="token punctuation">,</span> rej</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        <span class="token comment">// #ifdef APP-PLUS-NVUE</span>
        <span class="token function">rej</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">// #endif</span>
        <span class="token comment">// #ifndef APP-PLUS-NVUE</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token function">rej</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
                code<span class="token operator">:</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span>
                msg<span class="token operator">:</span> <span class="token string">'请用『方法名』.call(this)来调用'</span>
            <span class="token punctuation">}</span><span class="token punctuation">)</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">this</span><span class="token punctuation">.</span>$nextTick <span class="token operator">&amp;&amp;</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$nextTick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
			<span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
				<span class="token comment">// #ifdef H5</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token keyword">this</span><span class="token punctuation">.</span>$el<span class="token punctuation">)</span> <span class="token keyword">return</span> <span class="token function">rej</span><span class="token punctuation">(</span><span class="token punctuation">{</span>mag<span class="token operator">:</span> <span class="token string">'节点获取失败'</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//不存在节点信息就中断</span>
				<span class="token comment">// #endif</span>
				uni<span class="token punctuation">.</span><span class="token function">createSelectorQuery</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">in</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">[</span>isSelectAll <span class="token operator">?</span> <span class="token string">'selectAll'</span> <span class="token operator">:</span> <span class="token string">'select'</span><span class="token punctuation">]</span><span class="token punctuation">(</span>selecter<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">fields</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
				    size<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
				    rect<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
				    <span class="token operator">...</span>pro
				<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
				    <span class="token function">res</span><span class="token punctuation">(</span>Array<span class="token punctuation">.</span><span class="token function">isArray</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span> <span class="token operator">?</span> <span class="token punctuation">(</span>data<span class="token punctuation">.</span>length <span class="token operator">&gt;</span> <span class="token number">1</span> <span class="token operator">?</span> data <span class="token operator">:</span> data<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">:</span> data<span class="token punctuation">)</span><span class="token punctuation">;</span>
				<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">exec</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">// #endif</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="getparent"><a href="#getparent" class="header-anchor">#</a> getParent</h2> <ul><li>获取父组件的参数
<ul><li>this.$parent在非H5中，可以准确获取到父组件，但是在H5中，需要多次this.$parent.$parent.xxx</li> <li>这里默认值等于undefined有它的含义，因为最顶层元素(组件)的$parent就是undefined，意味着不传name</li> <li>值(默认为undefined)，就是查找最顶层的$parent</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">getParent</span><span class="token punctuation">(</span><span class="token parameter">name <span class="token operator">=</span> <span class="token keyword">undefined</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
	<span class="token keyword">let</span> parent <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>$parent<span class="token punctuation">;</span>
	<span class="token comment">// 通过while历遍，这里主要是为了H5需要多层解析的问题</span>
	<span class="token keyword">while</span> <span class="token punctuation">(</span>parent<span class="token punctuation">)</span> <span class="token punctuation">{</span>
		<span class="token comment">// 父组件</span>
		<span class="token keyword">if</span> <span class="token punctuation">(</span>parent<span class="token punctuation">.</span>$options <span class="token operator">&amp;&amp;</span> parent<span class="token punctuation">.</span>$options<span class="token punctuation">.</span>name <span class="token operator">!==</span> name<span class="token punctuation">)</span> <span class="token punctuation">{</span>
			<span class="token comment">// 如果组件的name不相等，继续上一级寻找</span>
			parent <span class="token operator">=</span> parent<span class="token punctuation">.</span>$parent<span class="token punctuation">;</span>
		<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
			<span class="token keyword">return</span> parent<span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
	<span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="guid"><a href="#guid" class="header-anchor">#</a> guid</h2> <p>-生成随机uid</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">guid</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">guid</span><span class="token punctuation">(</span><span class="token parameter">len <span class="token operator">=</span> <span class="token number">32</span><span class="token punctuation">,</span> firstU <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">,</span> radix <span class="token operator">=</span> <span class="token keyword">null</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> chars <span class="token operator">=</span> <span class="token string">&quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&quot;</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span>
        <span class="token string">&quot;&quot;</span>
    <span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> uuid <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    radix <span class="token operator">=</span> radix <span class="token operator">||</span> chars<span class="token punctuation">.</span>length<span class="token punctuation">;</span>

    <span class="token keyword">if</span> <span class="token punctuation">(</span>len<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> len<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span>
            uuid<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> chars<span class="token punctuation">[</span><span class="token number">0</span> <span class="token operator">|</span> <span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">*</span> radix<span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> r<span class="token punctuation">;</span>
        <span class="token comment">// rfc4122标准要求返回的uuid中,某些位为固定的字符</span>
        uuid<span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span> <span class="token operator">=</span> uuid<span class="token punctuation">[</span><span class="token number">13</span><span class="token punctuation">]</span> <span class="token operator">=</span> uuid<span class="token punctuation">[</span><span class="token number">18</span><span class="token punctuation">]</span> <span class="token operator">=</span> uuid<span class="token punctuation">[</span><span class="token number">23</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;-&quot;</span><span class="token punctuation">;</span>
        uuid<span class="token punctuation">[</span><span class="token number">14</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;4&quot;</span><span class="token punctuation">;</span>

        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> <span class="token number">36</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>uuid<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                r <span class="token operator">=</span> <span class="token number">0</span> <span class="token operator">|</span> <span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token number">16</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                uuid<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> chars<span class="token punctuation">[</span>i <span class="token operator">==</span> <span class="token number">19</span> <span class="token operator">?</span> <span class="token punctuation">(</span>r <span class="token operator">&amp;</span> <span class="token number">0x3</span><span class="token punctuation">)</span> <span class="token operator">|</span> <span class="token number">0x8</span> <span class="token operator">:</span> r<span class="token punctuation">]</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
    <span class="token comment">// 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>firstU<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        uuid<span class="token punctuation">.</span><span class="token function">shift</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> <span class="token string">&quot;u&quot;</span> <span class="token operator">+</span> uuid<span class="token punctuation">.</span><span class="token function">join</span><span class="token punctuation">(</span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
        <span class="token keyword">return</span> uuid<span class="token punctuation">.</span><span class="token function">join</span><span class="token punctuation">(</span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="addunit"><a href="#addunit" class="header-anchor">#</a> addUnit</h2> <p>-增加单位</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">addUnit</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">addUnit</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">'auto'</span><span class="token punctuation">,</span> unit <span class="token operator">=</span> <span class="token string">'rpx'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">function</span> <span class="token function">number</span><span class="token punctuation">(</span><span class="token parameter">value</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">return</span> <span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$</span><span class="token regex-delimiter">/</span></span><span class="token punctuation">.</span><span class="token function">test</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
    value <span class="token operator">=</span> <span class="token function">String</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token comment">// 用uView内置验证规则中的number判断是否为数值</span>
    <span class="token keyword">return</span> <span class="token function">number</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span> <span class="token operator">?</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>value<span class="token interpolation-punctuation punctuation">}</span></span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>unit<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span> <span class="token operator">:</span> value<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="calcfn"><a href="#calcfn" class="header-anchor">#</a> calcFn</h2> <p>-四则运算（加减乘除）</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token comment">//加</span>
<span class="token keyword">this</span><span class="token punctuation">.</span>$c<span class="token punctuation">.</span>calcFn<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>param1<span class="token punctuation">,</span> param2<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//减</span>
<span class="token keyword">this</span><span class="token punctuation">.</span>$c<span class="token punctuation">.</span>calcFn<span class="token punctuation">.</span><span class="token function">sub</span><span class="token punctuation">(</span>param1<span class="token punctuation">,</span> param2<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//乘</span>
<span class="token keyword">this</span><span class="token punctuation">.</span>$c<span class="token punctuation">.</span>calcFn<span class="token punctuation">.</span><span class="token function">mul</span><span class="token punctuation">(</span>param1<span class="token punctuation">,</span> param2<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//除</span>
<span class="token keyword">this</span><span class="token punctuation">.</span>$c<span class="token punctuation">.</span>calcFn<span class="token punctuation">.</span><span class="token function">divide</span><span class="token punctuation">(</span>param1<span class="token punctuation">,</span> param2<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">export</span> <span class="token keyword">const</span> calcFn <span class="token operator">=</span> <span class="token punctuation">{</span>
    <span class="token function">add</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> arg <span class="token operator">=</span> Array<span class="token punctuation">.</span><span class="token function">from</span><span class="token punctuation">(</span>arguments<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> arg<span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">total<span class="token punctuation">,</span> num</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token function">accAdd</span><span class="token punctuation">(</span>total<span class="token punctuation">,</span> num<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">sub</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> arg <span class="token operator">=</span> Array<span class="token punctuation">.</span><span class="token function">from</span><span class="token punctuation">(</span>arguments<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> arg<span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">total<span class="token punctuation">,</span> num</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token function">accSub</span><span class="token punctuation">(</span>total<span class="token punctuation">,</span> <span class="token operator">-</span>num<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">mul</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> arg <span class="token operator">=</span> Array<span class="token punctuation">.</span><span class="token function">from</span><span class="token punctuation">(</span>arguments<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> arg<span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">total<span class="token punctuation">,</span> num</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token function">accMul</span><span class="token punctuation">(</span>total<span class="token punctuation">,</span> num<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">divide</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">let</span> arg <span class="token operator">=</span> Array<span class="token punctuation">.</span><span class="token function">from</span><span class="token punctuation">(</span>arguments<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> arg<span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">total<span class="token punctuation">,</span> num</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token function">accDiv</span><span class="token punctuation">(</span>total<span class="token punctuation">,</span> num<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token comment">//说明：javascript的加法结果会有误差，在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。</span>
<span class="token comment">//调用：accAdd(arg1,arg2)</span>
<span class="token comment">//返回值：arg1加上arg2的精确结果</span>
<span class="token keyword">function</span> <span class="token function">accAdd</span><span class="token punctuation">(</span><span class="token parameter">arg1<span class="token punctuation">,</span> arg2</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">var</span> r1<span class="token punctuation">,</span> r2<span class="token punctuation">,</span> m<span class="token punctuation">;</span>
    <span class="token keyword">try</span> <span class="token punctuation">{</span>
        r1 <span class="token operator">=</span> arg1<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span>length<span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>e<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        r1 <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">try</span> <span class="token punctuation">{</span>
        r2 <span class="token operator">=</span> arg2<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span>length<span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>e<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        r2 <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    m <span class="token operator">=</span> Math<span class="token punctuation">.</span><span class="token function">pow</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> Math<span class="token punctuation">.</span><span class="token function">max</span><span class="token punctuation">(</span>r1<span class="token punctuation">,</span> r2<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span>arg1 <span class="token operator">*</span> m <span class="token operator">+</span> arg2 <span class="token operator">*</span> m<span class="token punctuation">)</span> <span class="token operator">/</span> m<span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token comment">//说明：javascript的减法结果会有误差，在两个浮点数相加的时候会比较明显。这个函数返回较为精确的减法结果。</span>
<span class="token comment">//调用：accSub(arg1,arg2)</span>
<span class="token comment">//返回值：arg1减上arg2的精确结果</span>
<span class="token keyword">function</span> <span class="token function">accSub</span><span class="token punctuation">(</span><span class="token parameter">arg1<span class="token punctuation">,</span> arg2</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token function">accAdd</span><span class="token punctuation">(</span>arg1<span class="token punctuation">,</span> <span class="token operator">-</span>arg2<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token comment">//说明：javascript的乘法结果会有误差，在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。</span>
<span class="token comment">//调用：accMul(arg1,arg2)</span>
<span class="token comment">//返回值：arg1乘以arg2的精确结果</span>
<span class="token keyword">function</span> <span class="token function">accMul</span><span class="token punctuation">(</span><span class="token parameter">arg1<span class="token punctuation">,</span> arg2</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">var</span> m <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span>
        s1 <span class="token operator">=</span> arg1<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        s2 <span class="token operator">=</span> arg2<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">try</span> <span class="token punctuation">{</span>
        m <span class="token operator">+=</span> s1<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span>length<span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>e<span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
    <span class="token keyword">try</span> <span class="token punctuation">{</span>
        m <span class="token operator">+=</span> s2<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span>length<span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>e<span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
    <span class="token keyword">return</span> <span class="token function">Number</span><span class="token punctuation">(</span>s1<span class="token punctuation">.</span><span class="token function">replace</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token function">Number</span><span class="token punctuation">(</span>s2<span class="token punctuation">.</span><span class="token function">replace</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">/</span> Math<span class="token punctuation">.</span><span class="token function">pow</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> m<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token comment">//说明：javascript的除法结果会有误差，在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。</span>
<span class="token comment">//调用：accDiv(arg1,arg2)</span>
<span class="token comment">//返回值：arg1除以arg2的精确结果</span>
<span class="token keyword">function</span> <span class="token function">accDiv</span><span class="token punctuation">(</span><span class="token parameter">arg1<span class="token punctuation">,</span> arg2</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">var</span> t1 <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span>
        t2 <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span>
        r1<span class="token punctuation">,</span> r2<span class="token punctuation">;</span>
    <span class="token keyword">try</span> <span class="token punctuation">{</span>
        t1 <span class="token operator">=</span> arg1<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span>length<span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>e<span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
    <span class="token keyword">try</span> <span class="token punctuation">{</span>
        t2 <span class="token operator">=</span> arg2<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span>length<span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>e<span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
    r1 <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>arg1<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">replace</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    r2 <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>arg2<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">replace</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span>r1 <span class="token operator">/</span> r2<span class="token punctuation">)</span> <span class="token operator">*</span> Math<span class="token punctuation">.</span><span class="token function">pow</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> t2 <span class="token operator">-</span> t1<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

</code></pre></div><h2 id="formatunit"><a href="#formatunit" class="header-anchor">#</a> formatUnit</h2> <p>-格式单位
+ @parmas val 值
+ @parmas unit rpx
+ @parmas deault 默认值</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">formatUnit</span><span class="token punctuation">(</span>val<span class="token punctuation">,</span> <span class="token string">'rpx'</span><span class="token punctuation">,</span> <span class="token string">'28'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">formatUnit</span><span class="token punctuation">(</span>val<span class="token punctuation">,</span> unit <span class="token operator">=</span> <span class="token string">'rpx'</span><span class="token punctuation">,</span> deault <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
	<span class="token keyword">return</span> <span class="token operator">!</span>val <span class="token operator">?</span> deault <span class="token operator">:</span> <span class="token function">validateFn</span><span class="token punctuation">(</span><span class="token string">'number'</span><span class="token punctuation">,</span> val<span class="token punctuation">)</span> <span class="token operator">?</span> <span class="token punctuation">(</span>val <span class="token operator">+</span> unit<span class="token punctuation">)</span> <span class="token operator">:</span> val<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="colortorgba"><a href="#colortorgba" class="header-anchor">#</a> colorToRgba</h2> <ul><li>JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba（255，255，255，0.5）字符串
<ul><li>color为传入的十六进制的色值</li> <li>alpha为rgba的透明度</li></ul></li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">//使用方法如下</span>
<span class="token function">colorToRgba</span><span class="token punctuation">(</span>color<span class="token punctuation">,</span>alpha<span class="token punctuation">)</span>

<span class="token comment">//方法</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">colorToRgba</span><span class="token punctuation">(</span><span class="token parameter">color<span class="token punctuation">,</span> alpha <span class="token operator">=</span> <span class="token number">0.3</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
	color <span class="token operator">=</span> <span class="token function">rgbToHex</span><span class="token punctuation">(</span>color<span class="token punctuation">)</span>
	<span class="token comment">// 十六进制颜色值的正则表达式</span>
	<span class="token keyword">var</span> reg <span class="token operator">=</span> <span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$</span><span class="token regex-delimiter">/</span></span>
	<span class="token comment">/* 16进制颜色转为RGB格式 */</span>
	<span class="token keyword">let</span> sColor <span class="token operator">=</span> color<span class="token punctuation">.</span><span class="token function">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
	<span class="token keyword">if</span> <span class="token punctuation">(</span>sColor <span class="token operator">&amp;&amp;</span> reg<span class="token punctuation">.</span><span class="token function">test</span><span class="token punctuation">(</span>sColor<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
		<span class="token keyword">if</span> <span class="token punctuation">(</span>sColor<span class="token punctuation">.</span>length <span class="token operator">===</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
			<span class="token keyword">var</span> sColorNew <span class="token operator">=</span> <span class="token string">'#'</span>
			<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> <span class="token number">4</span><span class="token punctuation">;</span> i <span class="token operator">+=</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
				sColorNew <span class="token operator">+=</span> sColor<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span> i <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">concat</span><span class="token punctuation">(</span>sColor<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span> i <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
			<span class="token punctuation">}</span>
			sColor <span class="token operator">=</span> sColorNew
		<span class="token punctuation">}</span>
		<span class="token comment">// 处理六位的颜色值</span>
		<span class="token keyword">var</span> sColorChange <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
		<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> <span class="token number">7</span><span class="token punctuation">;</span> i <span class="token operator">+=</span> <span class="token number">2</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
			sColorChange<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token function">parseInt</span><span class="token punctuation">(</span><span class="token string">'0x'</span> <span class="token operator">+</span> sColor<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span> i <span class="token operator">+</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
		<span class="token punctuation">}</span>
		<span class="token comment">// return sColorChange.join(',')</span>
		<span class="token keyword">return</span> <span class="token string">'rgba('</span> <span class="token operator">+</span> sColorChange<span class="token punctuation">.</span><span class="token function">join</span><span class="token punctuation">(</span><span class="token string">','</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">','</span> <span class="token operator">+</span> alpha <span class="token operator">+</span> <span class="token string">')'</span>
	<span class="token punctuation">}</span> 
	<span class="token keyword">else</span> <span class="token punctuation">{</span>
		<span class="token keyword">return</span> sColor
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新时间:</span> <span class="time">2021-03-10 10:30</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/saas-vuepress/指南/38.common-utils/06.global.html" class="prev">
        global
      </a></span> <span class="next"><a href="/saas-vuepress/指南/38.common-utils/08.pay.html">
        pay
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/saas-vuepress/assets/js/app.fa9b9339.js" defer></script><script src="/saas-vuepress/assets/js/2.03dacb0b.js" defer></script><script src="/saas-vuepress/assets/js/60.e5e36495.js" defer></script>
  </body>
</html>
